<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>menu</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script src="<%=basePath%>js/jquery-1.7.1.min.js" type=text/javascript></script>
	
	<link rel="stylesheet" href="<%=basePath%>css/jquery.treeview.css" />
	<link rel="stylesheet" href="<%=basePath%>css/screen.css" />
	
	<script src="<%=basePath%>js/jquery.cookie.js" type="text/javascript"></script>
	<script src="<%=basePath%>js/jquery.treeview.js" type="text/javascript"></script>

  	<script type="text/javascript">
	$(document).ready(function(){
		$("#browser").treeview({
			toggle: function() {
				//console.log("%s was toggled.", $(this).find(">span").text());
			}
		});
		
		/*$("#add").click(function() {
			var branches = $("<li><span class='folder'>New Sublist</span><ul>" + 
				"<li><span class='file'>Item1</span></li>" + 
				"<li><span class='file'>Item2</span></li></ul></li>").appendTo("#browser");
			$("#browser").treeview({
				add: branches
			});
		});*/
	});

	</script>
  
  </head>
  
  <body>
	<div id="main">
	
	<ul id="browser" class="filetree treeview-famfamfam">
		<li><span class="folder"><s:property value="ztrees.{^#this.ztree == null}.{name}[0]"/></span>
			<s:set var="trees" value="ztrees.{?#this.ztree != null}"/>
			<s:iterator var="tree" value="#trees">
			<ul>
				<li><span class="folder"><s:property value="#tree.name"/></span>
					<ul>
						<li><span class="file">11</span></li>
					</ul>
				</li>
			</ul>
			</s:iterator>
		</li>
		<!-- 
		<li><span class="folder">目录</span>
			<ul>
				<li><span class="folder">Item 1.1</span>
					<ul>
						<li><span class="file">Item 1.1.1</span></li>
					</ul>
				</li>
				<li><span class="folder">Folder 2</span>
					<ul>
						<li><span class="folder">Subfolder 2.1</span>
							<ul id="folder21">
								<li><span class="file">File 2.1.1</span></li>
								<li><span class="file">File 2.1.2</span></li>
							</ul>
						</li>
						<li><span class="folder">Subfolder 2.2</span>
							<ul>
								<li><span class="file">File 2.2.1</span></li>
								<li><span class="file">File 2.2.2</span></li>
							</ul>
						</li>
					</ul>
				</li>
				<li class="closed"><span class="folder">Folder 3 (closed at start)</span>
					<ul>
						<li><span class="file">File 3.1</span></li>
					</ul>
				</li>
				<li><span class="file">File 4</span></li>
			</ul>
		</li>
		 -->
	</ul>
	<s:debug></s:debug>
</div>
  </body>
</html>
